#ifndef     PATROLLINGAI_H_
# define    PATROLLINGAI_H_

# include "AAI.h"

class PatrolAI : public AAI
{
public:
    PatrolAI() : AAI(), _lastDir(GameObject::LEFT) {}
    virtual void update()
    {
        if (_mob->getCollision() & GameObject::LEFT)
            _lastDir = GameObject::RIGHT;
        else if (_mob->getCollision() & GameObject::RIGHT)
            _lastDir = GameObject::LEFT;
        _mob->move(_lastDir);
    }

private:
    GameObject::direction   _lastDir;
};

#endif   /* PATROLLINGAI_H_ */
